#include<iostream>
using namespace std;

int high(int a[],int n){
    int i;
    for(i=0;i<n-1;i++){
        if(a[i] > a[i+1])
            return -1;
    }
    return 1;
}

int low(int a[],int n){
    int i;
    for(i=0;i<n-1;i++){
        if(a[i] < a[i+1])
            return -1;
    }
    return 1;
}

int main(){
    int n;
    cin >> n;
    int a[n],i;
    for(i=0;i<n;i++)
        cin >> a[i];
    if( high(a,n) == 1 || low(a,n) == 1)
        cout << "sorted" << endl;
    else
        cout << "unsorted" << endl;
    return 0;
}
